Dynamic instruction and data updating architecture

ABSTRACT

A memory update engine provides flexible modification of data in memory. A processor may employ the update engine to update filter coefficients, special effects parameters, signal sample processing instructions, or any other instruction or data during processing. The update engine supports dynamic updating without requiring processor shutdown, thereby allowing the processor to seamlessly continue operation during a live performance.

PRIORITY CLAIM

This application claims the benefit of priority from U.S. ProvisionalPatent Application No. 60/830,166 filed 11 Jul. 2006.

BACKGROUND OF THE INVENTION

1. Technical Field

This disclosure relates to modifying data in memory. In particular, thisdisclosure relates to an architecture for dynamically updatinginstructions and data in a memory accessed by a digital signalprocessor.

2. Related Art

Rapid advances in technology, driven by strong market demand, haveyielded significant increases in microprocessor capability. Today,microprocessors are a common component of an endless array of devices.In many cases, the devices operate in real time on continuously changingdata. For example, a digital signal processor in a music effects systemmust rapidly apply sophisticated signal processing algorithms toincoming signal samples to deliver a desired sound output by applyingspecial effects, modifying loudness or directionality, performingmixing, filtering, equalization, or dynamic range control, or performingany of a myriad of other types of processing.

The digital signal processor relies almost completely on data in memory,including instructions and processing parameters, to perform its role.Yet, despite the rapid advancements in technology, the interface betweenthe memory, the digital signal processor, and external input was often alimiting factor. For example, providing new processing parameters orinstructions typically required the processor to shut down, awaitprovision of the new data, then restart. However, lengthy shutdown andrestart procedures compromised the ability of the processor to quicklyadapt to new processing roles, such as dynamically shifting betweenspecial effects applied to an audio signal during a live performance. Inother words, past memory interfaces were not sufficiently adept atproviding strong, flexible, and active support of a dynamic processingrole for the digital signal processor.

There is a need for an improved memory updating architecture.

SUMMARY

A memory update engine provides on-the-fly updating of instruction ordata memory. The memory update engine permits dynamic updating ofmemories while avoiding shutdown of the processor. Accordingly, thememory update engine permits the processor to update filtercoefficients, signal processing parameters, program instructions, or anyother instruction or data during live processing of input data, such assound samples received during a live performance.

The memory update engine includes a memory update RAM that stores updatedata (e.g., received from a host), a master frame synchronization input,and a follow-up frame synchronization output. In addition, the memoryupdate engine includes memory update logic operable to read a memoryupdate instruction to determine a destination memory and wait for amaster frame synchronization signal on the master frame synchronizationinput. Upon master frame synchronization, the memory update logic readsthe update data from the memory update RAM, updates the destinationmemory with the update data, and, when updating is complete, issues afollow-up frame synchronization signal to program restart logic.

BRIEF DESCRIPTION OF THE DRAWINGS

The disclosure can be better understood with reference to the followingdrawings and description in which FIGS. 1-11 show a pipelined processorarchitecture, and FIGS. 12-17 show a memory update engine. Thecomponents in the figures are not necessarily to scale, emphasis insteadbeing placed upon illustrating the principles of the disclosure.Moreover, in the figures, like referenced numerals designatecorresponding parts throughout the different views.

FIG. 1 shows a pipelined processing architecture that includes apipelined machine state.

FIG. 2 shows a block diagram of a digital signal processor thatincorporates a pipelined processing architecture.

FIG. 3 shows phase 1 of the pipelined processing architecture.

FIG. 4 shows phase 2 of the pipelined processing architecture.

FIG. 5 shows phase 3 of the pipelined processing architecture.

FIG. 6 shows phase 4 of the pipelined processing architecture.

FIG. 7 shows a portion of a machine state pipeline for program counterstate data in phase 3 of the pipelined processing architecture.

FIG. 8 shows a portion of a machine state pipeline for program counterstate data in phase 4 of the pipelined processing architecture.

FIG. 9 shows portions of a machine state pipeline for program counterstate data in phase 1 and phase 2 of the pipelined processingarchitecture.

FIG. 10 shows additional logic in the machine state pipeline in phase 3and phase 4 of the pipelined processing architecture.

FIG. 11 shows the acts taken to implement and execute a pipelinedprocessing architecture with a pipelined machine state.

FIG. 12 shows a digital signal processor that includes a memory updateengine.

FIG. 13 shows host registers for a memory update engine.

FIG. 14 shows the acts taken by the memory update engine.

FIG. 15 shows a memory update engine interfaced to Z-RAM and C-RAM.

FIG. 16 shows a memory update engine interfaced to microcode memory.

FIG. 17 shows multiplexer logic for selecting between multiple datavalues to apply to a memory.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The description below generally refers to FIGS. 1-11 in connection witha pipelined processor architecture. In addition, the description belowgenerally refers to FIGS. 12-17 in connection with a dynamic instructionand data updating architecture. While the pipelined processingarchitecture and the updating architecture may be used in conjunctionwith one another, either architecture may be implemented without theother.

FIG. 1 shows a pipelined processing architecture 100 (“architecture100”). The architecture 100 includes an instruction data pipeline 102and a machine state pipeline 104. The machine state pipeline 104provides relevant machine state to each of the data pipeline stages inthe instruction data pipeline 102. FIG. 1 also shows multiple phases,phases 1 through n, defined in the architecture 100. Each phase mayrepresent a discrete set of pipeline processing in the architecture 100(e.g., a set of processing that completes in one clock cycle), includingthe machine state applicable for that processing.

The instruction data pipeline 102 includes ‘n’ data pipeline stages.Three of the data pipeline stages are labeled in FIG. 1: the first datapipeline stage 106, the second data pipeline stage 108, and the nth datapipeline stage 110. Each data pipeline stage may implement any desiredprocessing. As examples, the data pipeline stages may include aninstruction fetch pipeline stage, and instruction decode pipeline stage,an address pipeline stage, a multiply pipeline stage, and accumulatepipeline stage, a data pipeline stage, or any other pipeline stage. Ingeneral, the data pipeline stages connect in series to provide start tofinish processing data as directed by a program instruction. Each datapipeline stage may be established so that the processing implemented bythat data pipeline stage completes in one clock cycle. In the examplediscussed below, stage 1 implements an address generation pipelinestage, stage 2 implements a data access pipeline stage, stage 3implements a multiply pipeline stage, and stage 4 implements anaccumulate pipeline stage. However, the architecture 100 may implementadditional, fewer, or different types of processing in the same ordifferent order in additional, fewer, or different data pipeline stages.

The machine state pipeline 104 includes ‘n’ pipelined machine statesthrough which state data propagates down the machine state pipeline 104.Three of the pipelined machine states are labeled in FIG. 1: the firstpipelined machine state 112, the second pipelined machine state 114, andthe nth pipelined machine state 116. Typically, there are as manypipelined machine states as there are data pipeline stages.

The machine state pipeline 104 connects to the instruction data pipeline102 to provide the applicable machine state for each program executed ineach instruction data pipeline stage. The machine state pipeline 104includes series connected register sections that propagate the machinestate down the machine state pipeline 104 to provide the applicablemachine state for each data pipeline stage. As a result, each datapipeline stage becomes an independent pipelined machine.

In one implementation, the instruction data pipeline 102 is a four stagedata pipeline. The four data pipeline stages include an addressgeneration pipeline stage, a data access pipeline stage, a multiplypipeline stage, and accumulate pipeline stage. However, additional,fewer, or different data pipeline stages may be implemented.

Each data pipeline stage independently operates on different data andcannot stall because of the unavailability of intermediate results. Theintermediate results for each program have propagated through the entirepipeline and are ready for the next instruction for that program. Table1, below, shows the four stage instruction data pipeline as it initiallyfills with data flowing through the pipeline. In Table 1, the notationPij refers to data for the i^(th) program and the j^(th) instruction inthat program. In other words, the architecture 100 sequentially loadsthe four state instruction data pipeline 102 with data for differentprograms and simultaneously executes instructions from four differentprograms.

TABLE 1 Phase 1 2 3 4 Clock Address Data Multiply Accumulate 1 P11 2 P21P11 3 P31 P21 P11 4 P41 P31 P21 P11

With the pipeline full of data from different programs, the architecture100 proceeds to add the data for the next instruction of each program tothe pipeline on subsequent clocks. Table 2 below shows severaliterations of the next several instructions.

TABLE 2 Phase 1 2 3 4 Clock Address Data Multiply Accumulate 5 P12 P41P31 P21 6 P22 P12 P41 P31 7 P32 P22 P12 P41 8 P42 P32 P22 P12 9 P13 P42P32 P22 10 P23 P13 P42 P32

Table 2 shows that when the data P12 enters the address phase, the datafor the prior instruction from program 1, P11, has exited the pipeline.As a result, the P11 data (e.g., an address calculation performed in theaccumulate pipeline stage) are complete and available to the nextinstruction in the program. Program 1 never stalls because the resultsof the prior instruction from program 1 are always complete when thesubsequent instruction begins execution. The same is true for all fourprograms. The next instruction in each program always has available thecomplete results of the prior instruction from that program. Theinstructions of each of four programs are interleaved in execution, with‘n’ clocks between subsequent instructions of the same program. The ‘n’clock interval permits data for each instruction to completely clear thepipeline, so that any subsequent data for an instruction from the sameprogram will have the results it may need from a prior instruction.

One beneficial result is that a programmer, compiler, or assembler neednot expend the resources to optimize code to avoid pipeline stalls. Theprogram cannot stall because the architecture 100 coordinates theexecution of instructions from three other programs while the data forthe instruction from the first program makes its way completely throughthe pipeline. In this way, the architecture 100 simultaneously executesmultiple different programs and implements true interleaved hardwaremultithreading.

The interleaving and the architecture 100 are not limited to four phasesor data pipeline stages. Instead, the architecture 100 may implementadditional, fewer, or different phases or data pipeline stages. Forexample, an additional data pipeline stage may be added to one or bothof the multiply pipeline stage or the accumulate pipeline stage.

Tables 1 and 2 show that each data pipeline stage in the architecture100 changes to data from a different program on each clock. For example,the multiply pipeline stage operates on P12 data, the P22 data, then P32data, then P42 data. The architecture provides each data pipeline stagewith a mechanism for keeping track of the execution state of eachprogram: a pipelined machine state. The machine state flows down themachine state pipeline 104 on each clock. As a result, as each datapipeline stage transitions to processing data for a different program,the pipelined machine state conveys the proper execution context to thedata pipeline stage. The data pipeline stage thereby continues executingeach program without losing track of the context (e.g., theaccumulators, addresses, and program counters) in which each program wasexecuting.

In other words each stage of the instruction data pipeline 102effectively becomes its own pipelined machine. To that end, thearchitecture 100 defines, maintains, and makes available a currentmachine state to each pipelined machine on each clock. In the exampleshown in the Figures and described below, the first machine does anaddress fetch while machine two does its data fetch. At the same time,machine three is performing a multiplication, while machine four isperforming an accumulate operation (or logical operation). Thearchitecture 100 therefore handles multiple truly simultaneous hardwarethreads.

The architecture 100 interfaces to a memory system. In one alternative,the memory system includes a data memory and a coefficient memory.However, the memory system may include additional, fewer, or differentmemories implemented with DRAM, SRAM, or any other memory technology.The discussion below describes an architecture 100 that interfaces to adata memory, termed a Z-RAM, and a coefficient memory, termed a C-RAM.While the Z-RAM and the C-RAM often store data values and coefficientsto multiply against the data values, respectively, the Z-RAM and theC-RAM may store any type of data. Below, the data memory index registerinto the Z-RAM is denoted Zi, while the coefficient memory indexregister into the C-RAM is denoted Ci.

The pipelined machine state may include a Program Counter (PC) state118, Address state 120, and Data state 120. The PC state 118 mayestablish and maintain a program counter for each data pipeline stage.The PC state 118 may further include return addresses, branch addresses,loop size data, loop position data, loop counter data, or other loopimplementation data. The Address state 120 may include one or more Z-RAMindices (e.g., a Zi register), one or more C-RAM indices (e.g., a Ciregister), or other address data. The Data state 122 may include flags,accumulators, or other data for each pipeline stage. The accumulators inthe Data state 122 may include an A accumulator, B accumulator, Caccumulator, a shift code register, and a MAC accumulator. Additional,fewer, or different accumulators may be established as part of thepipelined Data state 122.

The pipelined machine state may include additional, different, or fewerstates than those identified above. For example, the pipelined machinestate may also include a Microcode state 124 and an Intermediate Resultstate 126. The Microcode State 124 includes microcode instruction bitsthat propagate down registers in the machine state pipeline 104 for usein subsequent data pipeline stages. The Intermediate Result state 126includes flags, control bits, or other intermediate results decoded orotherwise determined in one data pipeline stage that propagate downregisters in the machine state pipeline 104 for use in subsequent datapipeline stages.

The flags in the pipelined machine state may specify condition codes andthe bit inversions of the condition codes. Examples of condition codesinclude Z (zero), P (positive), N (negative), and O (overflow). Thecondition codes are set in the accumulate pipeline stage. The Data statemay further include shift codes (stored, for example, in a shift coderegister). The shift codes may specify how many positions to shift, anda direction to shift, any result produced in the accumulate pipelinestage.

FIG. 2 shows a block diagram of a digital signal processor 200 that mayincorporate the architecture 100. The processor 200 includes a microcodememory 202, a Z-RAM 204, and a C-RAM 206. The processor 200 alsoincludes a data ALU 208 and an address ALU 210. Host registers 212implement a bidirectional communication interface between the processor200 and the host 214. The host 214 may be an onboard microcontroller, anexternal controller, or remote computer system as examples. In oneimplementation, the host registers 212 define one or more memorylocations that the host 214 reads and the processor 200 writes, and oneor more memory locations that the host 214 writes and the processor 200reads. The host 214 and processor 200 may read and write the hostregisters 212 at their own independent rates. The host registers 212 maybe defined in the host memory space or other memory spaces, and othertypes of communication interfaces may be implemented between theprocessor 200 and the host 214. Furthermore, some host registers 212 mayprovide control bits to the processor 200, rather than, or in additionto, providing general purpose read/write memory storage. Accordingly, onthe host side, the host 214 writes to selected host registers toprovide, on the architecture side, control signals to the processor 200.

The microcode memory 202 stores the microcode instructions thatimplement the instruction set supported by the processor 200. Themicrocode memory 202 may vary widely in size and width. For example, themicrocode memory may be 1K-4K by 8-128 bits wide, 2K-3K by 32-64 bitswide, or may adhere to any other organization depending on theimplementation desired.

The Z-RAM 204 and the C-RAM 206 are provided for program flexibility instoring and retrieving data. Other implementations may include only theZ-RAM 204, the C-RAM 206, or additional or different memories.Furthermore, the Z-RAM 204 or the C-RAM 206 may be included in memoryspaces with other memories, such as the host registers 212, externalmemory address buffers, external memory data buffers, input/output databuffers, or other memories. Any of the buffers may be implemented usingdouble buffered memory techniques that provide full read and writefunctionality out of and into the buffer for the circuitry on both“sides” of the buffer.

The Z-RAM 204 and the C-RAM 206 may vary widely in organization. Forexample, the Z-RAM 204 and the C-RAM 206 may be 1K-4K by 8-128 bitswide, 2K by 32-64 bits wide, or may have any other organizationdepending on the implementation desired.

The data ALU 208 implements the instruction data pipeline 102. Inparticular, the data ALU 208 may define four data pipeline stages: anaddress generation pipeline stage, a data access pipeline stage, amultiply pipeline stage, and an accumulate pipeline stage. The addressgeneration pipeline stage sets up the addresses, as examples, foraddressing C-RAM 206 and Z-RAM 204, for saving results in memory or inaccumulators, or for any other addressing. Data from the memories isread during the data access pipeline stage. During the multiply pipelinestage, a multiplier in the data ALU 208 forms the product of multipledata elements obtained during the data stage. During the accumulatepipeline stage, the data ALU 208 sums multiple data elements (including,for example, the product formed in the multiply stage), or performslogical operations on data elements.

The address ALU 210 implements a portion of the machine state pipeline104. In particular, the address ALU implements specific addressing modesand provides a pipeline to track the address portion of the executioncontext of each program. The addressing modes include a directaddressing mode and indirect addressing modes.

The direct addressing mode allows the microcode instruction to directlyspecify the address to be accessed. The indirect modes allow theprocessor 200 to access memory at a base address plus an offsetspecified in the microcode instruction. For example, the indirect modemay determine an address by adding an offset specified in the microcodeinstruction to the Zi register or Ci register. In addition, the indirectmodes also implement pre-modify and post-modify addressing. Accordingly,the address ALU 210 supports modifying (e.g., incrementing ordecrementing by 1) the Zi register and the Ci register before or afterthe Zi register or Ci register is used.

The architecture 100 may run on a master clock. The master clock may bea selectable multiple of a sampling rate. For example, for audioapplications, the master clock may run at a multiple (e.g., 3000) of a44.1 KHz audio sampling rate or any other sampling rate.

FIG. 3 shows the first phase 300 (“phase 1”) of the architecture 100.Phase 1 includes a portion of the machine state pipeline 104, includinga program counter state section 302, a data state section 304 and anaddress state section 306. Phase 1 also includes a portion of theinstruction data pipeline 102, including the address generation pipelinestage 308. The dashed line shows the end of phase 1 in the architecture100, while the logic to the left of the dashed line shows the logicincluded in phase 1. In other words, the dashed line shows where aninternal clock latches address data into registers or provides theaddress information to memories in order to begin retrieving data fromthe memories or store data into the registers to setup for phase 2.

In the program counter state section 302, the program counter resetlogic 310 determines whether to restart the program counter, to continueat the next location in the microcode program, or to load a new programcounter value. The program counter reset logic may be provided in eachphase to coordinate execution of the programs executed in each phase.The microcode program, the host 214, or another entity may provide aprogram counter restart signal. The program counter state section 302may define not only a program counter, but also looping registers. Thelooping registers may track loop size, loop position, a loop counter, abranch position, a return position, or other loop characteristics.

The current microcode instruction provided on the microcode data line312 provides control bits for the phase 1 logic. Any of the microcodebits or results determined in phase 1 may be stored in microcodepipeline registers or result pipeline registers and passed along downthe pipeline for use in subsequent phases. FIG. 3 shows an example of apipelined microcode register 314 and a result pipeline register 315 forthe decoded conditional accumulator load signal.

The microcode instruction provides control bits to the condition codedecode logic 316 and at the condition load decode logic 318. Thecondition code decode logic 316 and the condition load decode logic 318determine on what conditions and to what registers or other memoryspaces results should be written. For example, the microcode controlbits may specify no condition, conditional accumulator loading,conditional memory addressing or conditional memory writing. Themicrocode control bits may also specify that the conditional actionsshould occur based on a negative or not negative, a positive or notpositive, a zero or not zero, or an overflow or not overflow condition.

The address generation pipeline stage 308 includes the multiplexer 320.The multiplexer 320 selects between multiple data elements to provide tothe Z-RAM 204 and the C-RAM 206. The microcode instruction providescontrol bits on the multiplexer selection input 322. The multiplexer 320selects between a Zi input, a Ci input, an A accumulator input, and a Baccumulator input. However in other implementations, the multiplexer 320may select between additional, fewer, or different inputs. As examples,the multiplexer 320 may also provide a selection between constants suchas ‘0’, ‘1’, and ‘−1’, additional or different accumulators, data fromthe host registers 212, specific bits of other registers or accumulatorsor any other input data elements. Accordingly, the multiplexer 320, andthe microcode control bits, may expand to support any desired number ofselectable data elements.

The data state section 304 includes the normalization and shifting logic324 that feeds the A and B accumulator registers. The normalization andshift logic 324 implements bit shifting of accumulator results to theleft or to the right according to the value written into shift register.The normalization and shift logic 324 also implements normalizationprocessing of the accumulator results (e.g., left shifting to removeredundant sign bits).

In other implementations, the normalization and shift logic 324 may beimplemented in phase 4, the accumulate phase, along with saturationprocessing. However, saturation, normalization, and shifting operationstend to be time consuming operations. Therefore, dividing theseprocessing steps into different pipeline phases reduces the time neededin any particular pipeline phase to allow the logic to settle andproduce the results. These operations may therefore be distributedbetween different pipeline phases, so that no single pipeline phase hasto incur the logic settling delay for all of the operations.Specifically, implementing the normalization and shift logic 324 inphase 1 allows the pipeline clock to run faster and increase thethroughput of the pipeline.

The address state section 306 implements direct and indirect addressingmodes. In implementation shown in FIG. 3, direct and indirect addressingmodes are present for both the Z-RAM 204 and C-RAM 206 for a Zi registerand a Ci register, respectively. In other implementations, multipleindex registers (e.g., Z1 and Z2 index registers, and C1 and C2 indexregisters) may be established and pipelined for each memory. Themicrocode instruction provides addressing mode control bits on themicrocode input 326. The address instruction decode logic 328 determineswhich addressing mode is selected and responsively outputs multiplexercontrol signals 330 to implement the addressing mode.

The address offset and segmentation logic 332 may implement specialmemory addressing modes and are optional features of the architecture100. In one implementation, the address offset and segmentation logic332 add an offset (e.g., stored in a register or maintained in acounter) to the address in a manner transparent to the processor. Theoffset and segmentation logic 332 may thereby turn an absolute addressinto an indirect address. As a result, the processor 200 gains theefficiency of writing to an absolute address while the hardwareautomatically adjusts the address with an offset. In addition, theaddress offset and segmentation logic 332 may include a comparator thatcompares the current address against a segmentation register toascertain whether the offset logic and adder should be used to modifythe address with the offset. When the address is outside of the segment,the offset logic and adder do not influence the address value. Instead,the address may increment by one. Alternatively or additionally, thearchitecture 100 may add additional memory index registers in whichpre-computed memory offsets are stored for convenient access.

FIG. 4 shows the second phase 400 (“phase 2”) of the architecture 100.The dashed line labeled ‘Phase 1’ passes through the memory elements atthe end of phase 1 that store the results of the phase 1 logic. Thedashed line labeled ‘Phase 2’ passes through the memory elements at theend of phase 2 that store the results of the phase 2 logic. Some of thedata (e.g., the A accumulator value, B accumulator value, and thecondition flag bits) from phase 1 flows between registers (e.g., the A,B, and condition flag registers) to phase 2. In addition, the phase 2logic determines values for the multiply operation performed in phase 3and that are stored in the registers through which the ‘Phase 2’ dashedline passes. Phase 2 includes a portion of the machine state pipeline104, including a program counter state section 402, a data state section404 and an address state section 406. Phase 2 also includes a portion ofthe instruction data pipeline 102, including the data access pipelinestage 408.

In the data access pipeline stage 408, the X multiplexer 410 and Ymultiplexer 412 provide a selection of data inputs to the logic in thenext phase (phase 3). The microcode instruction provides bits thatcontrol the selection. The control bits are pipelined to phase 3 usingpipelined microcode registers (e.g., the register 414). The data inputsshown in FIG. 4 include the A accumulator, B accumulator, Z-RAM data,and C-RAM data.

In other implementations, additional, fewer, or different data inputsmay be provided on either or both of the X multiplexer 410 or Ymultiplexer 412. For example, the data inputs may include constants suchas ‘1’, ‘−1’, ‘2’, ‘0.5’, ‘0.25’, ‘0’, ‘16’, or other constants. Thedata inputs may further include additional accumulator inputs, inputsfrom the host registers, portions of the accumulators (e.g., thefractional part or exponent of a number), or other data inputs. The datainputs available on the X multiplexer may be different than the datainputs available on the Y multiplexer.

FIG. 5 shows an example of the third phase 500 (“phase 3”) of thearchitecture 100. The dashed lines pass through the memory elements thatstore the results of the phase 2, and phase 3 logic. Some of the datafrom phase 2 flows between registers to phase 3. In addition, the phase3 logic generates other data (e.g., the product the data values input tothe multiply phase) that the data pipeline stage stores in the registersat the end of phase 3. Phase 3 includes a portion of the machine statepipeline 104, including a program counter state section 502, a datastate section 504 and an address state section 506. Phase 3 alsoincludes a portion of the instruction data pipeline 102, including amultiply pipeline stage 508.

A multiplier 510 forms the product of two data inputs previouslyselected in phase 2, illustrated in FIG. 4. The multiplier 510 may be afixed point multiplier, two's complement multiplier, floating pointmultiplier, or other multiplier. Specifically, the outputs of the Xmultiplexer 410 and Y multiplexer 412, clocked into the registers 416 atthe end of phase 2, provide the data inputs to the multiplier 510. WhileFIG. 5 shows two 32 bit data inputs multiplied to form a 64 bit output,the data inputs and outputs may be of different bit sizes in otherimplementations.

The B multiplexer 512 sets up one input for the following accumulatepipeline stage. The microcode instruction includes control bits whichdetermine which B multiplexer input is selected. In FIG. 5, the Bmultiplexer 512 inputs include the A accumulator, the B accumulator, thedata retrieved from Z-RAM 204 and the data retrieved from C-RAM 206.

In other implementations, the B multiplexer 512 accepts additional,fewer, or different data inputs. For example, the B multiplexer 512 mayaccept constants such as ‘1’, ‘−1’, ‘0.5’, ‘0’, or other constants. Thedata inputs may further include additional accumulator inputs, inputsfrom the host registers, portions of the accumulators (e.g., thefractional part or exponent of a number), portions of the programcounter state (e.g., the program counter or program counter returnvalue), or other data inputs.

FIG. 6 shows the fourth phase 600 (“phase 4”) of the architecture 100.The dashed lines pass through clocked storage elements (e.g., registers,DRAM, SRAM, or other memory) that store the results of the phase 3 logicat the end of that phase, and the phase 4 logic at the end of thatphase. Some of the data from phase 3 flows between registers to phase 4.In addition, the phase 4 also generates new data that may be stored inthe registers at the end of phase 4. Phase 4 includes a portion of themachine state pipeline 104, including a program counter state section602, a data state section 604 and an address state section 606. Phase 4also includes a portion of the instruction data pipeline 102, includingthe accumulate pipeline stage 608.

The accumulate pipeline stage 608 includes adder/logic decode logic 610,saturation decode logic 612, and accumulator loading decode logic 614.The adder in the accumulate pipeline stage 608 may be a fixed pointadder, two's complement adder, floating point adder, or other adder. Theadder/logic decode logic 610 decodes microcode bits that specify theoperation to perform in the accumulate pipeline stage 608. Theadder/logic decode logic 610 provides control outputs to the accumulatecircuitry 616. The accumulate logic 616 may include an adder, Booleanlogic circuitry (e.g., AND or XOR logic), or other circuitry. Inresponse to the control outputs, the accumulate pipeline stage 608 mayadd multiple data inputs, or perform logic operations on those inputs asspecified by the control outputs. To that end, the microcode bits andthe control outputs may specify an Add operation, a Subtract operation,and AND operation, or an XOR operation, as examples.

The microcode bits may further select from between additional inputs(beyond those provided by the B multiplexer 512). For example, anadditional multiplexer may be added to the other input of the adder,with additional microcode bits, intermediate results, and/or decodinglogic to produce a control signal that chooses the input value to passthrough the additional multiplexer. In one implementation, theadditional multiplexer may accept a conditional subtract input (e.g.,stored in a C accumulator), the output of the multiplier 510, a shiftedversion of the output of the multiplier (e.g., the output times16-shifted 4 bits to the left), or other inputs.

The saturation logic 618 implements saturation processing of theaccumulator results. The multiplexer 620 selectively provides either theoutput of the adder or the Boolean logic circuitry to the saturationlogic 618. In response to the saturation decode logic 612, thesaturation logic 618 limits the output. The saturation logic 618 maylimit the output, as examples, to 1, 8, 128, any other magnitude, orperform no saturation. In other words, when saturation is selected, thesaturation logic replaces an out-of-bounds value produced by theaccumulate pipeline stage with the maximum positive or maximum negativevalue that is within the specified bounds. A value that the accumulatepipeline stage produces that is already in the specified bounds passesthrough without change. The saturation logic 618 thereby provides auseful mechanism for limiting the dynamic range of results produced inthe accumulate pipeline stage.

The accumulator decode logic 614 responds to microcode instruction bitsthat specify which accumulator(s) to load. Accordingly, when theaccumulate pipeline stage 608 obtains the result, the selectedaccumulator or accumulators are loaded. To that end, the microcodeinstruction bits may specify that any combination of one or more of thefollowing should be loaded with the accumulator pipeline stage result:the A accumulator, B accumulator, PC, or any other register.

The accumulator loading is further influenced by the load conditionsdiscussed in the address pipeline stage 300. The flag determinationlogic 622 determines the conditions associated with the accumulatorpipeline stage result (e.g., zero, positive, negative, or overflow). Theload conditions may direct the architecture to load the accumulators orto forgo loading the accumulators with a new value, based in part on theflags set or cleared by the flag determination logic 622.

FIG. 6 shows the multiplexers (e.g., the accumulator multiplexers 624)that select the data to load into the accumulators. The data may be theresult of the accumulate pipeline stage 608, or the prior accumulatorvalue, as examples. Note that shifting and normalization occurs in phase1, as noted above in the discussion of phase 3.

FIG. 6 also shows Zi decode logic 626 and Ci decode logic 628. The logic626, 628 operates on the output of the saturation logic 618. Forexample, the logic 626, 628 may select specific bits of the 64 bitoutput to load into the Zi or Ci register. Thus, when the C-RAM memory216 or Z-RAM memory 214 is smaller than 64 bits of addressable space,the logic 626, 628 may pick the appropriate number of bits (e.g., 10,for a 1024 addressable location Z-RAM) to load. As a result, the Zi andCi registers may be loaded with the new value provided on the output ofthe saturation logic 618, or with the prior value of the Ci and Ziregisters. The index multiplexers 630 and 631 provide the selectionbased on the control bits provided on the index selection line 632 bythe address ALU instruction decode logic shown in FIG. 3.

The program counter update logic and looping logic 634 coordinatesupdating of the PC and looping registers. The program counter tracks thecurrent program position for each stage of the pipeline. The loopingregisters keep track of the looping parameters that determine how manyloops to perform, the loop length, and other loop characteristics.

A more detailed view of an implementation of the program counter statesections 302, 402, 502, and 602 is shown in FIGS. 7-10. As noted above,the program counter state sections 302, 402, 502, and 602 implement andmaintain the program counters for each independent machine defined bythe pipeline and also implement and maintain looping registers forhigh-speed hardware support of software loops.

FIG. 7 shows a phase 3 section 700 of the machine state pipeline 104 forhandling program counter state. The phase 3 section 700 includes aprogram counter section 702, and a looping control section 704. Thelooping control section 704 includes a return section 706, a branchsection 708, a loop size section 710, a loop position section 712, and aloop counter section 714. FIG. 7 shows program counter state data fromlogic in phase 4 of the architecture 100 provided on the program counterstate data inputs 718. The program counter state data is used in phase 4(shown in FIG. 8) to load, as examples, the program counter, loop size,and loop count. In other words, rather than loading an accumulator atthe end of phase 4, the architecture 100 may load program counter statedata using results obtained by the phase 4 logic that would otherwisehave been stored in an accumulator.

In one implementation, the program counter state data inputs 718 providea PC branch value (e.g., 12 bits), a number of lines in the loop (e.g.,a 9 bit loop size), the number of loops to execute (e.g., a 10 bit loopcount), and a return/subroutine flag (e.g., 1 bit). Thereturn/subroutine flag may determine, in conjunction with the loop size,whether to initiate a jump to a new location, a jump to (or a returnfrom) a subroutine, or a jump to the beginning of a loop. Accumulatorloading decode logic in phase 4 provides the load PC control signal 738that influences loading new program counter state data in phase 4, andas shown in FIG. 8. The program restart logic 736 coordinates therestarting of programs in each hardware thread as described in moredetail below.

In the program counter section 702, a two input multiplexer 716 selectsbetween values to load into the phase 3 PC register 720. The valuesinclude the value of the current PC, plus 1, provided by the adder 717,or a PC start value from the host register. The restart signal isprovided by a frame synchronization signal (e.g., a signal thatspecifies the arrival of a new sample of data), by the currentlyexecuting program, by a restart value written to a host register, or byanother mechanism.

The return registers (e.g., the phase 3 return register 722) in thereturn register section 706 track where the program should return towhen the subroutine is complete. The branch registers (e.g., the phase 3branch register 724) provided in the branch register section 708 trackwhere the program is jumping to, or looping back to. The loop sizeregisters (e.g., the phase 3 loop size register 726) provided in theloop size register section 710 track the size of the loop in terms ofthe number of instructions. The loop position registers (e.g., the phase3 loop position register 728) in the loop position section 712 track thecurrent position in the loop (e.g., when the loop position=0, thecurrent iteration of the loop is completed). The loop counter registers(e.g., the phase 3 loop counter register 730) in the loop countersection 714 track the number of additional loops to be performed (e.g.,when the loop counter=0, the last iteration of the loop is completed).

The subroutine detection logic 732 determines when a subroutine iscalled. The subroutine return logic 734 determines when to return from asubroutine. The subroutine detection logic 732 generates a multiplexercontrol signal that selects between a PC branch value and a PC returnvalue in phase 4. The subroutine return logic 732 generates amultiplexer control signal that is used in selecting between the nextline of the PC or a PC return value.

FIG. 8 shows a phase 4 section 800 of the machine state pipeline 104 forhandling program counter state. In phase 4, the architecture 100 loadsor updates the program counter and looping variables using programcounter state data provided on the program counter state data inputs718. For example, the PC control multiplexers 802 determine whether toupdate the phase 4 PC register 804 with: 1) the next line in theprogram, i.e., PC+1; 2) a PC branch value; 3) a PC return value; 4) a PCbranch return value; or 5) a new PC start value.

The return register control multiplexer 806 determines whether to updatethe phase 4 return register 808 with: 1) the next line in the program,i.e., PC+1; or 2) a PC return value. The branch register controlmultiplexer 810 determines whether to update the phase 4 branch register812 with: 1) the PC branch value; or 2) the PC branch return value. Theloop size register control multiplexer 814 determines whether to updatethe phase 4 loop size register 816 with: 1) the new loop size value(e.g., for when a new loop is starting); or 2) the current loop sizevalue that is held until the loops are finished and that is reloaded foreach loop iteration.

In addition, the loop position control multiplexers 816 determinewhether to update the phase 4 loop position register 818 with: 1) thenew loop position value (e.g., set to the loop size when a new loop isbegun); 2) a current loop size value (e.g., when the current iterationof a loop is finished and the next iteration of the loop is begun); or3) an updated loop position value (e.g., the prior loop position—1,decremented as the architecture 100 makes its way through the loop). Theloop position logic 820 generates a reload loop control signal based onloop position=0 AND loop counter is not equal to 0. Thus, when there areadditional loops left to process, and the end of the current loop isreached (e.g., loop position=0), then the loop position is reloaded withthe loop size. Furthermore, the loop position logic 820 generates a loopcounter enable signal, for example when loop counter is not equal to 0(e.g., when there are additional loops to process).

The loop counter control multiplexer 822 determines whether to updatethe phase 4 loop counter 824 with: 1) the loop count value; or 2) adecremented loop count; or 3) a non-decremented loop count. For example,when there are additional loops to process (e.g., loop count is notequal to 0), then the loop count is decremented and loaded into thephase 4 loop count register 824.

FIG. 9 shows phase 1 and phase 2 sections 900 of the machine statepipeline 104 for handling program counter state. The dashed lines passthrough the memory elements that propagate the PC and looping databetween registers 902, 904, 906, 908, 910, and 912 between phase 1 andphase 2. FIG. 9 also shows the PC loading multiplexers 914 and 916 thatselectively load the PC in phase 1 or phase 2 with a new PC start value.

FIG. 10 shows additional logic in the phase 3 and phase 4 sections ofthe machine state pipeline 104. FIG. 10 illustrates that PC address isapplied to the microcode memory 202 in phase 3 to obtain the nextmicrocode instruction for phase 4. The next microcode instruction isclocked into the microcode register 1002 in phase 4. The microcode bitsare thereby available to control the execution of the pipelinedarchitecture 100 through subsequent phases 1 to 4.

The machine state pipeline 104 includes program restart logic 736 todetermine when to reload the program counter for each pipeline phase(and thus for each independent hardware thread). The program restartlogic 736 may implement independent reset control over each programcounter register and selected loop registers in each pipeline phase. ThePC selection input may specify which program counters to reload. Thus,as shown in FIG. 7, the program restart logic, 736 provides fourindependent restart signals Restart1, Restart2, Restart3, and Restart4.Each restart signal reloads the particular PC register, and clears thereturn register, loop position register, and loop counter register for aparticular pipeline phase. For example, Restart3 reloads the PC andclears the registers for the third independent hardware thread runningin phase 3 of the pipeline. The program restart logic 736 may assert allof the restart signals at the same time. Restarting each of the programcounter registers at the same time provides for four synchronizedindependent hardware threads to execute on the architecture 100.

However, rather than reloading all of the program counter registers atonce, the program restart logic 736 may individually determine which ofthe program counter registers to load in response to a load condition(e.g., a hardware reset, a load request from the host, or a load requestfrom an executing program). The program restart logic 736, for example,may assert the restart signals to provide round-robin restart of the ‘n’program counter registers in the ‘n’ pipeline stages. In that case, thearchitecture 100 provides execution of a program that is, effectively,‘n’ times as long as a program under the circumstance where all theprogram counter registers are restarted together. When processing audiosamples, for example, each pipeline stage may execute an audioprocessing program which operates on the output of the program executingin the prior pipeline stage. The architecture 100 allows the audioprocessing program to be effectively ‘n’ times longer than it otherwisecould be.

FIG. 11 summarizes the acts taken to implement and execute the pipelinedarchitecture 100. An instruction processing architecture is divided into‘n’ data pipeline stages (Act 1102). For example, the data pipelinestages may include an address generation pipeline stage, a data accesspipeline stage, a multiply pipeline stage, and an accumulate pipelinestage, although additional, fewer, or different data pipeline stages maybe implemented. The ‘n’ data pipeline stages provide independenthardware threads that execute ‘n’ programs. Each clock brings aninstruction from the next program into the data pipeline. The datapipeline operates in a round-robin manner, returning to obtain the nextinstruction from the first program after the instruction from program‘n’ (i.e., the last program) has begun execution.

To support the independent hardware threads, a pipelined machine stateis provided (Act 1104). The pipelined machine state may propagatethrough registers down the machine state pipeline. Each data pipelinestage therefore has the proper context provided for executing each ofthe ‘n’ programs, as the pipeline stage changes to a new program (of the‘n’ programs) each clock. The pipelined machine state may include aProgram Counter (PC) state 118, Address state 120, and Data state 122.The pipelined machine state may include additional, different, or fewerstates, such as a Microcode state 124 and an Intermediate Result state126.

The architecture 100 clocks in data for an instruction from program 1into the pipeline (Act 1106). The clock also propagates machine statealong the machine state pipeline 104 (Act 1107). Accordingly, thepipeline stage that processes the instruction has the proper executioncontext (e.g., including PC, accumulator values, and addressinformation) for processing the data for the instruction in that datapipeline stage.

Each clock introduces data for a new instruction from one of the ‘n’programs into the instruction data pipeline 102. The clocks alsopropagate the data for the prior instruction down the instruction datapipeline 102. (Acts 1108, 1110, and 1112). At the same time, the machinestate flows down the machine state pipeline 104 to provide the propercontext for processing the data for each instruction (Acts 1109, 1111,and 1113). The architecture 100 processes new instructions andpropagates machine state as long as there are instructions to execute.

The architecture 100 includes microcode updating logic. The microcodeupdating logic loads the contents of the microcode memory 202 toinitially setup, replace, correct, or extend the microcode instructions.FIG. 10 shows that the microcode updating logic provides microcodeupdate data on the data lines 1004. While the microcode is updated, themicrocode update logic may also provide a write protect signal on thewrite protect line 1006 to prevent undesired output from the microcodememory 202 from being written into the microcode register 1002 whileupdates occur.

FIG. 12 shows an implementation of a digital signal processor 1200 thatincorporates a memory update engine 1202. The memory update engine 1202may be used in conjunction with the instruction processing architecture100 described above. The memory update engine 1202 obtains updateparameters (e.g., addresses, data and instructions) for the microcodememory 202, Z-RAM 204, or C-RAM 206 from a memory update RAM 1204. Thehost 214 may provide the update parameters to the memory update RAM 1204through the memory update host registers 1206. The host 214 also writesto the memory update host registers 1206 to provide control bits to thememory update engine 1202, and reads from the memory update hostregisters 1206 to obtain status information from the memory updateengine 1202. Depending on the implementation, the memory update engine1202 may perform updates on additional, fewer, or different memories.

The memory update engine 1202 provides dynamic updating of microcodeinstructions or of data in the Z-RAM 204 or C-RAM 206 without requiringthe DSP 1200 to shutdown or stop processing for an extended number ofclock cycles. As a result, the DSP 1200 effectively continues processingdata without interruptions. Thus, for example, a DSP 1200 that processessound samples may seamlessly change during live performances. Asexamples, the host 214 may change filter coefficients, special effectsparameters, microcode instructions for processing sound samples, or anyother parameters on-the-fly.

FIG. 13 shows the memory update host registers 1206 in more detail. Thememory update host registers 1206 provide operational parameters andcontrol instructions to the memory update engine 1202 and also providestatus bits for the host 214. The memory update host registers 1206include a busy register 1302, a full register 1303, a start updateregister 1304, and an update instruction repeat register 1306. Inaddition, the memory update host registers 1206 include an updateinstruction register 1308, an update count register 1310, an updateaddress register 1312, and a load data register 1314. An update dataregister 1316 stores an update parameter provided by the host 214, whilea microcode data register 1317 stores a microcode instruction. Thememory update engine 1202 reads the microcode instruction from themicrocode memory 202 and stores it in the microcode data register 1317in response to a request from the host 214. Each register 1302-1317 maybe implemented as one or more bits in a data unit (e.g., an 8-bit memorylocation) in the host memory space, or any other memory space. Asdescribed in more detail below, the start update register 1304 and theupdate instruction register 1308 provide different mechanisms forinitiating execution of the memory update engine 1202. Other mechanismsmay be used, depending on the implementation.

Table 3, below, shows one example of the distribution of the registers1302-1317 in the host registers 212. In particular, Table 3 shows thatthe update data register 1316 is implemented as four 8-bit memorylocations (32 bits labeled UpdData0-UpdData31), and that the updateaddress register 1312 spans two 8-bit memory locations (12 bits labeledUpdAddr0-UpdAddr11). The update data register 1316 may storeinstructions that update the microcode memory 202, data that updatesdata in the Z-RAM 204 or C-RAM 206, memory addresses to update, or anyother type of update parameter. In addition, Table 3 shows that severalof the registers define status bits. For example, bit 7 of the updateaddress register 1312 provides a ready/busy status bit. Any otherdistribution or organization of the registers may be established, andadditional, fewer, or different control or data registers may beemployed.

TABLE 3 Memory Load and Update Host Registers Address Bit Hex Dec 7 6 54 3 2 1 0 0C 12 0D 13 UpdStat UpdFull UpdAddr11 UpdAddr10 UpdAddr9UpdAddr8 0E 14 UpdAddr7 UpdAddr6 UpdAddr5 UpdAddr4 UpdAddr3 UpdAddr2UpdAddr1 UpdAddr0 0F 15 UpdCnt4 UpdCnt3 UpdCnt2 UpdCnt1 UpdCnt0 10 16UpdData31 UpdData30 UpdData29 UpdData28 UpdData27 UpdData26 UpdData25UpdData24 11 17 UpdData23 UpdData22 UpdData21 UpdData20 UpdData19UpdData18 UpdData17 UpdData16 12 18 UpdData15 UpdData14 UpdData13UpdData12 UpdData11 UpdData10 UpdData9 UpdData8 13 19 UpdData7 UpdData6UpdData5 UpdData4 UpdData3 UpdData2 UpdData1 UpdData0 14 20 UpdStat/Ld15 21 UpdInstrRpt UpdInstr3 UpdInstr2 UpdInstr1 UpdInstr0

Table 4 provides an explanation of the address, data, and status bitsshown in Table 3. A status bit, ‘UpdStat’, indicates whether the memoryupdate engine 1202 is ‘busy’ (i.e., performing an update) or ‘ready’(i.e., ready to perform an update). A full bit, ‘UpdFull’, indicateswhether the memory update RAM is full. The host 214 may check the fullbit before writing another data unit to the memory update RAM 1204. Thestatus bit, full bit or both may be provided in multiple locations inthe host registers for convenient access. Additionally, the status bitand full bit may be combined into a single status bit with a temporaldistinction in role. For example, before the host 214 initiates thememory update, the role of the combined status bit may be to reflectwhether the memory update RAM 1204 is full. After the host 214 initiatesthe memory update, the role of the combined status bit may be to reflectwhether the memory update engine 1202 is busy performing the memoryupdate. Any particular implementation may define additional, fewer, ordifferent status bits.

TABLE 4 Memory Update Address, Data, and Status Bits Bit FieldExplanation UpdStat Status provided by the update engine, for example, 0= ready, 1 = busy (Update Status) UpdAddr[11:0] The address whereupdating will start. The address may be relative (Update to the memoryspace being updated (e.g., microcode, Z-RAM or C- Address) RAM).UpdInstr (Table 5) determines the memory space to update. UpdFullIndicates whether the memory update RAM is full, for example, 0 = notfull, 1 = full. (Update Full) UpdCnt[4:0] Holds the count of units thehost will update, minus 1. The units may (Update Count) be continuous ormay be in any arbitrary order. UpdData[31:0] A 32 bit data unit thatwill update a unit in one of the DSP's memory (Update Data) spaces(e.g., microcode, Z-RAM, or C-RAM). Two units may be written per 64 bitmicrocode line, with the least significant word written first.UpdStat/Ld The host writes a ‘1’ to this bit to instruct the DSP to loadthe data in (Update Load) UpdData[31:0] into the memory update RAM 1204.

To setup the parameters that will update one of the memories, the host214 writes parameters to the update data register 1316, then sets theload data register 1314 to ‘2’. The memory update engine 1202 respondsby writing the parameter in the update data register 1316 into thememory update RAM 1204 and resetting the load data register 1314 to ‘0’.The memory update engine 1202 increments an internal memory counter thatspecifies the next location in the memory update RAM 1204 to write to.The memory counter may roll over to zero when it reaches the end of thememory update RAM 1204. In addition, when the memory update engine 1202has written to the last location in the memory update RAM 1204, thememory update engine 1202 may set a full flag in the full register 1303.The host 214 may thereby determine when the memory update RAM 1204 hasstored as many update values as it can hold.

The host 214 need not fill the entire memory update RAM 1204 with updatevalues. Instead, the host 214 may store one, two, or any other number ofupdate values in the memory update RAM 1204, subject to the capacity ofthe memory update RAM 1204. The host 214 writes to the update countregister 1310 to specify the number of data units for the memory updateengine 1202 to update. As examples, the data unit may be a 64-bitmicrocode instruction or a 32-bit data word in Z-RAM 204 or C-RAM 206.Other memories in the processor may have different organizations thatadhere to different data unit sizes (e.g., 8-bits).

In one implementation, the memory update engine 1202 initiates a memoryupdate after the host 214 writes a valid (e.g., non-zero) updateinstruction to the update instruction register 1308. Prior to the updateinstruction, the host 214 therefore provides the update data, updateaddress, update instruction repeat data, and update count to the memoryupdate engine 1202. When the master frame synchronization signalarrives, the memory update engine 1202 executes the memory update when avalid update instruction has been provided. When the update finishes,the memory update engine 1202 clears the update instruction register1308. In other implementations, the memory update engine 1202 mayinitiate a memory update after the host 214 writes to the start updateregister 1304. The memory update engine 1202 then clears the startupdate register 1304 when the update completes. More generally, the hostestablishes a start update condition to initiate operation of the memoryupdate engine 1202, and the memory update engine 1202 clears the startupdate condition when the update is complete. A non-zero updateinstruction and writing a start update bit are two examples of suchstart update conditions.

Table 5 provides an explanation of the update instruction register bitsshown in Table 3. The host 214 writes to the update instruction register1308 to specify the particular updating operation that the memory updateengine 1202 will perform. The update instruction register 1308 alsospecifies the memory that the memory update engine 1202 will write to.

The memory update engine 1202 may write update data in a non-sequentialor sequential address order. For non-sequential addresses, the host 214may write a sequence of address and data parameter pairs to the memoryupdate RAM 1204. The addresses specify the locations to write the data.For sequential addresses, the host provides a starting address on theupdate address register 1312 and the memory update engine 1202automatically increments by one the last address for each data unitwritten.

TABLE 5 Update Instruction Bit Field Value Explanation UpdInstr[1:0] 0No Update (Memory Specifier) 1 Update Z-RAM 2 Update C-RAM 3 UpdateMicrocode Memory UpdInstr[2] 0 The memory update engine 1202 reads thememory (Sequential/ update RAM 1204 to obtain an address, then reads theNonsequential next data unit from the memory update RAM to obtain theUpdate) data to be written to that address. The memory update engine1202 may write to non sequential addresses. 1 The memory update engine1202 updates addresses by incrementing the address after data iswritten. The update address is used as the starting address. UpdInstr[3]0 Write to memory, as specified by UpdInstr[1:0] (Read/ Update) 1 Readmicrocode from a location specified by the update address register. Thehost may load the address to read before setting this bit. The memoryupdate engine writes the data from the microcode memory 202 into thehost registers as Microcode Data[63:0] UpdInstrRpt 0 The memory updateengine 1202 updates the data once. (Instruction Repetition) 1 The memoryupdate engine 1202 repeatedly updates the data at a predeterminedinterval (e.g., each frame synchronization) until this register is setto 0. As an alternative, the memory update host registers 1206 mayprovide multiple bits for the update instruction repeat register 1306.The update instruction repeat register 1306 may then specify a countvalue for the number of times to repeat the memory update operationusing the data loaded into the memory update RAM 1204. The memory updateengine 1202 may load the count into an internal register and decrementthe register after each update. When the count reaches zero, the memoryupdate engine 1202 may clear the update instruction repeat register1206, set a done flag in the memory update host registers 1206, or takeanother action.

The host interface, update data register 1316, memory update RAM 1204,microcode memory 202, Z-RAM 204, and/or C-RAM 206 may have differentsizes and organizations. Thus, while the update data register 1316 isshown as spanning 32 bits, the update data register may instead be 8bits wide, 16 bits wide, 64 bits wide, or any other width. Similarly,the memory update RAM 1204 may be organized as 32 words×32 bits perword, 16 words×64 bits per word, or any other organization. Increasingthe memory update RAM capacity increases the number of microcodeinstructions or memory locations that may be updated in one updatecycle.

In one implementation, the microcode memory 202 is 64 bits wide whilethe Z-RAM 204 and C-RAM 206 are 32 bits wide. Accordingly, to update amicrocode instruction, the host 214 may write two 32-bit values into thememory update RAM 1204. For example, the two 32-bit values may bewritten least significant word followed by most significant word. Thememory update engine 1202, when updating a microcode instruction, maythen read two 32-bit values from the memory update RAM 1204. The memoryupdate engine 1202 holds one 32-bit value internally while retrievingthe second 32-bit value in order to obtain the entire 64-bit microcodeinstruction from the memory update RAM 1204.

In one implementation, the memory update engine 1202 updates the memoryspecified in the update instruction register 1308 between samples ofincoming data. For example, the memory update engine 1202 may initiatethe memory update operation upon receipt of a master framesynchronization signal on the master frame synchronization input 1318.The master frame synchronization signal indicates that a new data samplehas arrived. When the memory update operation is complete, the memoryupdate engine 1202 may then issue a follow-up frame synchronizationsignal to other logic in the processor (e.g., the program restart logic736) on the follow-up frame synchronization output 1320. As noted abovewith regard to FIG. 7, the program restart logic 736 may use the framesynchronization signal to restart one or more programs that process thenext data sample. In other words, the memory update engine 1202 delaysprogram restart until memory updating has finished.

FIG. 14 shows the acts taken by the memory update engine 1202. Thememory update engine 1202 may be implemented as a state machine, as acontroller operating under program control, or using other logic orcircuitry. The memory update engine 1202 waits for the master framesynchronization signal (Act 1402). The memory update engine then checkswhether the host 214 has stored a valid (e.g., non-zero) updateinstruction into the update instruction register 1308 (Act 1404).Alternatively, the memory update engine 1202 may check whether the host214 has written to the start update register 1304, or the host 214 hasestablished any other start update condition. When no update will bedone (e.g., because no valid update instruction has been provided), thememory update engine 1202 issues the follow-up frame synchronizationsignal (Act 1420).

Otherwise, the memory update engine 1202 loads an internal addresscounter with the contents of the update address register 1312 (Act1406). The memory update engine 1202 also places the update count valueinto a countdown register (Act 1408). The memory update engine 1202 thenreads data values from the memory update RAM 1204 and increments theaddress counter on each read.

For each data unit retrieved from the memory update RAM 1204, the memoryupdate engine writes the data unit to memory specified in the updateinstruction. For example, for each microcode instruction update, thememory update engine 1202 reads two 32-bit data values from the memoryupdate RAM 1204, and writes the 64-bit microcode instruction to themicrocode RAM 202.

When the update instruction specifies sequential addressing, the memoryupdate engine 1202 reads the data unit from the memory update RAM 1204(Act 1408), writes the data unit to the selected memory (Act 1410),increments the address counter into the selected memory (Act 1412), anddecrements the countdown register (Act 1414). The memory update engine1202 continues to read data units from the memory update RAM 1204 untilthe countdown register reaches zero.

When the update instruction specifies non-sequential addressing, thememory update engine 1202 reads a first parameter, an address, from thememory update RAM 1204 (Act 1416) followed by a second parameter, a dataunit, to write to that address (Act 1418). The memory update engine 1202writes the data unit to the selected memory (Act 1419). The memoryupdate engine 1202 reads as many data units as the update count valuespecifies. When the counter is decremented to zero, the update isfinished, and the memory update engine 1202 issues the follow-up framesynchronization signal (Act 1420) to restart one or more programs. If itwas set to initiate the memory update operation, the memory updateengine 1202 also clears the start update condition (e.g., by clearingthe update instruction register 1308 or the start update register 1304)(Act 1422).

FIG. 13 shows that the memory update engine 1202 also issues a microcodewrite protect signal 1322. As shown in FIG. 10, the write protect signal1322 ensures that the microcode register 1002 is loaded with known data(e.g., all zeros or any other bit pattern representing a NOPinstruction) while the memory update engine 1202 is updating memory.According, the instruction pipeline 100 is protected against makingunpredictable changes to previously determined results stored in thememories or accumulators.

FIG. 15 shows the memory update engine 1202 interfaced to the Z-RAM 204and C-RAM 206. The start upload signal 1502 provides a multiplexercontrol signal that selects the memory update data signals 1504 and thememory update address signals 1506 for application to the C-RAM 206 andZ-RAM 204. In addition, depending on the memory selected by the updateinstruction register 1308, the memory update engine asserts either theC-RAM write signal 1508 or the Z-RAM write signal 1510.

The C-RAM 206 and the Z-RAM 204 are generally accessible by the pipelinearchitecture 100 described above. Accordingly, the processor provides amechanism for passing update data to the C-RAM 206 and Z-RAM 204. Inparticular, the processor implements multiplexer selection logic for thesignals applied to the C-RAM 206 and Z-RAM 204. As shown in FIG. 15, themultiplexer selection logic includes a C-RAM write signal multiplexer1512, a C-RAM address signal multiplexer 1514, and a C-RAM datamultiplexer 1516. The multiplexer selection logic also includes a Z-RAMwrite signal multiplexer 1518, a Z-RAM address signal multiplexer 1520,and a Z-RAM data multiplexer 1522. The multiplexer selection logic isresponsive to the start upload signal 1502 to select address, data, andwrite signals generated by the memory update engine 1202 for applicationto the C-RAM 206 and Z-RAM 204.

FIG. 16 illustrates one example of data override logic 1600 for applyingthe update data on the memory update data signals 1504 to the C-RAM 206and Z-RAM 204. In the example shown in FIG. 16, the CZ data multiplexer320 includes multiple inputs 1602, including an input for the memoryupdate data signals 1504. The update data signals 1504 are provided oninput 15 of the CZ data multiplexer 320. An OR gate 1604 responds to thestart upload signal 1502 by forcing the multiplexer selection input 322to all ‘1’s, thereby selecting input 15 (i.e., the update data signals1504) for output to the C-RAM 206 and Z-RAM 204. Thus, the CZ datamultiplexer 320 may implement the functionality of the C-RAM datamultiplexer 1516 and the Z-RAM data multiplexer 1522.

Similarly, override logic may be provided for the memory update addresssignals 1506 and for the write signals 1508 and 1510. For example, theaddress signal multiplexers 350 and 354 and the write signalmultiplexers 352 and 356 shown in FIG. 3 may be extended to provideinputs for the memory update address signals 1506 and for the writesignals 1508 and 1510. Address and write override logic may be providedto select the memory update address signals 1506 and the write signals1508 and 1510 for application to the Z-RAM 204 and C-RAM 206 when thememory update engine 1202 asserts the start upload signal 1502.

FIG. 17 shows the memory update engine 1202 interfaced to the microcodememory 202. In particular, FIG. 17 shows that the memory update engine1202 provides a 64-bit microcode instruction to the microcode memory 202on the memory update data signals 1504 (for the lower 32-bits of theinstruction) and on the supplemental data signals 1702 (for the upper32-bits of the instruction). The memory update engine 1202 asserts themicrocode write signal 1704 to write the 64-bit microcode instruction tothe microcode memory 202.

A microcode address selection multiplexer 1706 determines which addresssignals are applied to the microcode update memory 202. Under control ofthe start upload signal 1502, the microcode address selectionmultiplexer 1706 selects between an address generated by the address ALU210 and the memory update engine 1202. When the memory update engine1202 is used with the pipeline architecture 100, the address selectionmultiplexer 1706 may be added prior to the address input to themicrocode memory 202 shown in FIG. 10.

The architecture 100 and memory update engine 1202 may be implemented insoftware, for example, in the form of a hardware emulator program thatincludes instructions that emulate the operations described above,including the acts discussed with respect to FIGS. 11 and 14.Accordingly, the architecture 100 or engine 1202 may be represented in amachine readable memory such as RAM, ROM, or Compact Disc. For example,a program stored in a machine readable memory may emulate thearchitecture 100 or engine 1202. The program may be encoded in and/orcommunicated in an electromagnetic signal to other entities.

While various embodiments of the invention have been described, it willbe apparent to those of ordinary skill in the art that many moreembodiments and implementations are possible within the scope of theinvention. Accordingly, the invention is not to be restricted except inlight of the attached claims and their equivalents.

1. A memory update engine for updating memory accessible to a processor,the memory update engine comprising: an update instruction register; anupdate data memory; a synchronization input; and update logic coupled tothe update instruction register, the update data memory, and thesynchronization input; the update logic operable to: wait for a framesynchronization signal on the synchronization input; read an updateinstruction from the update instruction register; and perform an updateoperation specified in the update instruction on the memory using updateparameters stored in the update data memory.
 2. The memory update engineof claim 1, where the update instruction register comprises a memoryspecifier bit field.
 3. The memory update engine of claim 1, where theupdate instruction register comprises a sequential/non-sequential updatespecifier bit field.
 4. The memory update engine of claim 1, where theupdate instruction register comprises a read/update specifier bit field.5. The memory update engine of claim 4, where the read/update specifierbit field comprises: a microcode read specifier bit field; and anaddress of a microcode data register coupled to the update logic.
 6. Thememory update engine of claim 1, where the update operation comprises adata memory write operation.
 7. The memory update engine of claim 1,where the update operation comprises a microcode write operation.
 8. Amemory update engine for updating memory accessible to a processor, thememory update engine comprising: a synchronization input; a follow-upsynchronization output; an update instruction register; and update logiccoupled to the update instruction register, the synchronization input,and the follow-up synchronization output, the update logic operable to:wait for a frame synchronization signal on the synchronization input;read an update instruction from the update instruction register; performan update operation specified in the update instruction on the memory;and issue a follow-up frame synchronization signal to the processor onthe follow-up synchronization output after the update operationcompletes.
 9. The memory update engine of claim 8, further comprising:an update data memory coupled to the update logic; and an update dataregister coupled to the update logic.
 10. The memory update engine ofclaim 9, further comprising an update status register coupled to theupdate logic.
 11. The memory update engine of claim 9, where the updatedata memory is operable to store a microcode update instruction, wherethe update operation specified in the microcode update instructioncomprises a microcode update operation.
 12. The memory update engine ofclaim 11, further comprising a count register coupled to the updatelogic and operable to specify an update count.
 13. The memory updateengine of claim 9, further comprising an update load register coupled tothe update logic.
 14. The memory update engine of claim 9, furthercomprising an update instruction repetition bit field operable tospecify whether to repeat the update operation.
 15. A method forupdating memory accessible to a processor, the method comprising:reading a memory update instruction to determine a destination memory inthe memory; waiting for a frame synchronization signal; and in responseto the frame synchronization signal: reading update parameters from anupdate data memory; updating the destination memory according to theupdate parameters; and issuing a follow-up frame synchronization signalto the processor when updating completes.
 16. The method of claim 15,further comprising: receiving the update parameters from a hostinterface; and storing the update parameters in the update data memory.17. The method of claim 15, where reading update parameters comprisesreading microcode instructions; and where updating the destinationmemory comprises updating a microcode memory with the microcodeinstructions.
 18. The method of claim 15, further comprising: reading anupdate instruction from an update instruction register; and whereupdating comprises updating the destination memory according to theupdate parameters and the update instruction.
 19. The method of claim18, where reading an update instruction comprises reading an updateinstruction comprising a memory specifier field.
 20. The method of claim18, where reading an update instruction comprises reading an updateinstruction comprising an instruction repetition field.
 21. The methodof claim 18, where reading an update instruction comprises reading aread/update specifier field.
 22. The method of claim 18, where readingan update instruction comprises reading a sequential/non-sequentialupdate field.
 23. The method of claim 18, further comprising reading anupdate address to determine a starting address in the destinationmemory.
 24. The method of claim 18, further comprising reading an updatecount to determine a number of data units in the destination memory toupdate.
 25. The method of claim 18, further comprising setting an updatestatus bit to ‘busy’ to communicate whether updating is occurring.